//
//  newsDetailViewController.m
//  A Learning Walk
//
//  Created by dllo on 16/6/18.
//  Copyright © 2016年 战斗民族. All rights reserved.
//

#import "newsDetailViewController.h"

@interface newsDetailViewController ()<UIWebViewDelegate>

@end

@implementation newsDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"%@",self.myId);
    // Do any additional setup after loading the view.
    //加载webview
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    webView.scalesPageToFit = YES;
    webView.delegate = self;
    [webView setOpaque:NO];//opaque是不透明的意思
    [webView setScalesPageToFit:YES];//自动缩放以适应屏幕
    NSString *string = [NSString stringWithFormat:@"http://cont.app.autohome.com.cn/autov4.2.5/content/News/newscontent-a2-pm1-v4.2.5-n%@-lz0-sp0-nt0-sa1-p0-c1-fs0-cw320.html",self.myId];
    NSURL *url = [NSURL URLWithString:string];
    NSURLRequest* request = [NSURLRequest requestWithURL:url];//创建NSURLRequest
    [webView loadRequest:request];//加载
    [self.view addSubview:webView];
    [webView release];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(leftAction)];
    UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fx"] style:UIBarButtonItemStylePlain target:self action:@selector(itemOne)];
    UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"sc_n"] style:UIBarButtonItemStylePlain target:self action:@selector(itemTwo)];
    self.navigationItem.rightBarButtonItems = @[item1,item2];
    
    
}

-(void)itemOne{

}
-(void)itemTwo{
    
}



-(void)leftAction{
    [self.navigationController popViewControllerAnimated:YES];
}

@end
